<?php

$sfAsset = $author->getSfAsset();
$hasAvatar = !is_null($sfAsset) && $sfAsset->getFilename() ? true : false;
if($hasAvatar):
    $imagesAttributes = Utils::getImageSize($sfAsset->getFolder(), $sfAsset, 100, 98);
endif;
?>
<div class="avatar-box">
    <div class="content-avatar-box">
        <?php if($hasAvatar): ?>
            <?php echo image_tag($imagesAttributes['large']['url'], array('title' => $sfAsset->getFilename(), 'width' => $imagesAttributes['large']['width'], 'height' => $imagesAttributes['large']['height'], 'style' => 'margin-top: ' . $imagesAttributes['large']['marginTop'] . 'px; margin-left: ' . $imagesAttributes['large']['marginLeft'] . 'px')) ?>
        <?php else: ?>
            <?php echo image_tag('/images/noavatar.png', array('title' => 'aucun avatar', 'width' => '100', 'height' => '98')) ?>
        <?php endif ?>
    </div>
</div>